import { GET, POST } from "@/api";
import { config } from "@/config";
import { VagueOject } from "@/types/common";
import { ArticleType, ArticleInfoType } from "@/types/response/home";


//登录
export const app_user = async (data:{name:string,pwd:string}, header: VagueOject = {}): Promise<any> => {
    console.log("app",app_user.prototype.url)
    console.log("config.apiList.app.login",config.apiList.app.login)
    return await POST<any>({ 
        baseUrl: app_user.prototype.base,
        url: config.apiList.app.login,
        data,
        header
    })
}

//toke
export const app_info = async (data:{}, header: VagueOject = {}): Promise<any> => {
    console.log("app",app_user.prototype.url)
    console.log("config.apiList.app.login",config.apiList.app.login)
    return await POST<any>({ 
        baseUrl: app_info.prototype.base,
        url: app_info.prototype.url,
        data,
        header
    })
}

//注册
export const app_add = async (data:{name:string,pwd:string}, header: VagueOject = {}): Promise<any> => {
    console.log("app",app_user.prototype.url)
    console.log("config.apiList.app.login",config.apiList.app.add)
    return await POST<any>({ 
        baseUrl: app_add.prototype.base,
        url: app_add.prototype.url,
        data,
        header
    })
}